<script>

function fn(n) {
  return new Promise(resolve => resolve(n))
}
let obj = {a:1}
// console.log(obj, fn(obj))

new Promise(resolve => resolve())
  .then(() => fn(obj))
  .then(v=> console.log(v))

function fn2(s) {
  return new Promise((resolve, reject) => reject(s))
}
new Promise(resolve => resolve())
  .then(() => fn2('aaaa'))
  .catch(v=> console.log(v))

</script>